<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateChallengeGamesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('challenge_games', function (Blueprint $table) {
            $table->increments('id');
            $table->string('city', 50)->comment('城市码');
            $table->integer('play_a')->comment('挑战者');
            $table->integer('play_b')->comment('应战者')->nullable();
            $table->integer('type')->default(1)->comment('类型(1.个人赛，2.团队赛)');
            $table->datetime('game_datetime')->comment('比赛时间');
            $table->integer('score_a')->comment('A得分')->nullable();
            $table->integer('score_b')->comment('B得分')->nullable();
            $table->integer('status')->default(10)->comment('状态(10.比赛中，20.结算，30.异常，40.完结)');
            $table->integer('view')->default(0)->comment('查看次数');
            $table->integer('is_true')->default(1)->comment('虚拟')->nullable();

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('challenge_games');
    }
}
